package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.util.List;
@ApiModel(value = "用户对象", description = "封装用户对象相关信息")
@TableName("t_user")
public class UserBean {
    @ApiModelProperty("编号")
    @TableId(value = "pk_userId",type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("账号")
    @TableField("u_account")
    private String account;
    @ApiModelProperty("密码")
    @TableField("u_password")
    private String password ="123";
    @ApiModelProperty("真实姓名")
    @TableField("u_name")
    private  String name;
    @TableField("u_salt")
    private String salt;
    @TableField(exist = false)
    private List<RoleBean> roleBeans;

    @TableField(exist = false)
    private List<GradeBean> gradeBeans;
    public UserBean() {
    }

    public UserBean(String account, String password, String name) {
        this.account = account;
        this.password = password;
        this.name = name;
    }

    public String getSalt() {
        return salt;
    }

    public void setSalt(String salt) {
        this.salt = salt;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<RoleBean> getRoleBeans() {
        return roleBeans;
    }

    public void setRoleBeans(List<RoleBean> roleBeans) {
        this.roleBeans = roleBeans;
    }

    public List<GradeBean> getGradeBeans() {
        return gradeBeans;
    }

    public void setGradeBeans(List<GradeBean> gradeBeans) {
        this.gradeBeans = gradeBeans;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", account='" + account + '\'' +
                ", password='" + password + '\'' +
                ", name='" + name + '\'' +
                ", salt='" + salt + '\'' +
                ", roleBeans=" + roleBeans +
                ", gradeBeans=" + gradeBeans +
                '}';
    }
}
